﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ALiteTeam.PackageTracer.Core.Impl
{
    public class NetTrafficHandler : INetTrafficHandle
    {
        public NetTrafficHandler()
        {
        }

        public double GetTotal()
        {
            var result = Settings.Configuration.NetTraffic + Settings.Configuration.NetTrafficBySystem;            
            return result;
        }

        public void Clear()
        {
            Settings.Configuration.NetTraffic = 0;
            Settings.Configuration.NetTrafficBySystem = 0;
        }

        public void Increase(double amount, bool isSystem)
        {
            if (isSystem == true)
            {
                Settings.Configuration.NetTrafficBySystem += amount;
            }
            else
            {
                Settings.Configuration.NetTraffic += amount;
            }
        }
    }
}
